import { Matrix4 } from "three";
import GameObject from "../gameObject/GameObject";
import Geo from "../gameObject/Geo";
import Mat from "../gameObject/Mat";
import Mesh from "./Mesh";
import GameApplication from "../../system/GameApplication";

//scene的幕布
export default class MyView extends Mesh {


    public constructor(name: string) {
        const w = 1;
        const h = 1;
        const geo = new Geo({
            data: {
                'a_Position': {
                    size: 3, array: new Float32Array([
                        -w, h, 0,
                        -w, -h, 0,
                        w, -h, 0,
                        w, h, 0,
                    ])
                },
                'a_Pin': { size: 2, array: new Float32Array([0, 1, 0, 0, 1, 0, 1, 1]) },
            },
            element: { array: new Uint16Array([0, 1, 2, 0, 2, 3]) }
        });
        const mat = new Mat({
            program: 'view',
            mode: ['TRIANGLES'],
            data: {
                'u_ModelM4': { type: 'uniformMatrix4fv', value: new Matrix4().elements },
            },
        });
        super(name, { geo: geo, mat: mat });
    }





}